﻿
//监听好友状态
function FreindsManage() {alert(this.req.responseText);
    if (document.getElementById("myFriendsList").innerText == "加载中…") {
        document.getElementById("myFriendsList").innerText = "";
    }
    if (this.req.responseText == "" || this.req.responseText==undefined)
    { return; }
    else {
        var friendsList = this.req.responseText;
        for (var i = 0; friendsList[i] != undefined; i++) {
            if (document.getElementById(friendsList[i] + "_friendsName") == null) {
                document.getElementById("myFriendsList").innerHTML +=
                "<div display='block' ><input type='text' id='" +
                friendsList[i] +"_friendsName"+
                "'  class='freindName' ondblclick='NewChatWindow(this);' value='" +
                friendsList[i] +
                "' readonly='readonly' /></div>";
            }
        }
     }
 }

 function ListenFriends() {
    name = document.getElementById("name").value;
    var url = "AjaxResponse/GetFriendsList.aspx?name=" + name;
    new ContentLoader(url, FreindsManage);
}